import urlUtil from '../../common/util/urlUtil.js'

const navigator = {
	goto(url = '', params = {}, redirect = false) {
		url = urlUtil.getFetchUrl(url, params)
		console.log(url)
		if (redirect) {
			uni.redirectTo({
				url
			})
		} else {
			uni.navigateTo({
				url
			})
		}
	},
	goBack() {
		uni.navigateBack({})
	}
}

export default navigator